<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>话题详细</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">

    <link th:href="@{/css/semantic.min.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/css/mian.css}">
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body class="lay-blog" >

<!--菜单-->
<ul class="layui-nav layui-bg-blue" lay-filter="">
    <li class="layui-nav-item "><a href="/" style="font-size: 20px">首页</a></li>
    <li class="layui-nav-item">
        <a href="javascript:;" style="font-size: 20px">习题库</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{/item/chapter/overview}">分章节练习</a>
            </dd>
            <dd>
                <a th:href="@{/item/overview}">分题型练习</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item">
        <a href="javascript:;" style="font-size: 20px">课程分类</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{'/course/type_show/'+${coursetype.getId()}}" th:each="coursetype:${coursetypes}" th:text="${coursetype.getCourse_name()}"></a>
            </dd>
            <dd>
                <a th:href="@{/course/type_show/0}" >全部课程</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item layui-this" th:if="${session.loginuser} == null"><a th:href="@{/community/index}" style="font-size: 20px">社区</a></li>
    <li class="layui-nav-item layui-this" th:if="${session.loginuser} != null">
        <a href="javascript:;" style="font-size: 20px">社区</a>
        <dl class="layui-nav-child">
            <dd><a th:href="@{/community/index}">社区首页</a></dd>
            <dd><a th:href="@{/stu/community/commenting}">发布话题</a></dd>
            <dd><a th:href="@{/stu/community/management}">我的话题</a></dd>
            <dd><a th:href="@{/stu/chat_all}" target="_blank">头脑风暴</a></dd>
        </dl>
    </li>
    <li class="layui-nav-item"><a th:href="@{/file/list}" style="font-size: 20px">资料干货</a></li>

    <!--如果没有登录-->
    <li class="layui-nav-item" th:if="${session.loginuser} == null">
        <a th:href="@{/login}" style="font-size: 20px">登录</a>
    </li>
    <li class="layui-nav-item" th:if="${session.loginuser} == null">
        <a th:href="@{/register}" style="font-size: 20px">注册</a>
    </li>
    <!--如果没有登录-->

    <!--如果登录-->
    <li class="layui-nav-item" th:if="${session.loginuser} != null">
        <a href="javascript:;" style="font-size: 20px">我的班级</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{/stu/map/show}">班级签到</a>
            </dd>
            <dd>
                <a th:href="@{/stu/exam/overview}">班级考试</a>
            </dd>
            <dd>
                <a th:href="@{/stu/exam/mydegree/list}">我的考试成绩</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item" th:if="${session.loginuser} != null">
        <a href="javascript:;" style="font-size: 20px">好友管理</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{/stu/friends/list}">好友列表</a>
            </dd>
            <dd>
                <a th:href="@{/stu/friends/search}">搜索好友</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item" th:if="${session.loginuser} != null">
        <img th:src="@{'/show/'+${session.loginuser.getId()}}" class="layui-nav-img">[[${session.loginuser.username}]]
        <dl class="layui-nav-child">
            <dd><a th:href="@{/stu/center}">个人中心</a></dd>
            <dd><a th:href="@{/stu/logout}">退出</a></dd>
        </dl>
    </li>

    <!--如果登录-->
</ul>
<!--菜单-->


<!--评论信息-->
<div class="container-wrap">
    <div class="container container-message container-details">
        <div class="contar-wrap">

            <!--        课程信息-->
            <div class="item">
                <div class="item-box  layer-photos-demo1 layer-photos-demo">
                    <input type="hidden" id="myid" th:value="${comment.getId()}">
                    <h4>评论者：<span th:text="${comment.getUsername()}"></span></h4>
                    <h5>发布于：<span th:text="${#dates.format(comment.getCreatetime(),'yyyy年MM月dd日 HH:mm')}"></span></h5>
                    <p th:text="${comment.getComment()}"></p>
                </div>
            </div>
            <!--            课程信息-->
            <a name="comment"> </a>
            <div class="comt layui-clear">
                <div  class="pull-left">全部评论</div>
            </div>
            <!--评论内容-->
            <div id="LAY-msg-box">
                <div class="info-item" th:each="reply:${replies}">
                    <span><img class="layui-nav-img" th:src="@{'/show/'+${reply.getUser_id()}}" ></span>
                    <span class="name">[[${reply.getUsername()}]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                    <span th:text="${#dates.format(reply.getCreatetime(),'yyyy-MM-dd HH:mm')}"></span>
                    <div class="info-text">
                        <p class="info-intr" th:text="${reply.getContent()}"></p>
                    </div>

                    <div class="title count" >
                        <div th:if="${session.loginuser} != null">
                            <div class="pull-left" th:if="${session.loginuser.getId()==reply.getUser_id()}">
                                <a th:href="@{'/stu/community/blog/comment/reply/delete/'+${comment.getId()}+'/'+${reply.getId()}}"> <i class="layui-icon layui-icon-delete"></i> 删除</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--评论内容-->

            <!--            写评论-->
            <div class="comt layui-clear">
                <div  class="pull-left">写评论</div>
            </div>
            <form class="layui-form" th:action="@{/stu/community/blog/comment/reply/submit}">
                <!--                <input type="hidden" name="user_id" th:value="${topic.getUser_id()}">-->
                <!--                <input type="hidden" name="user_name" th:value="${topic.getUsername()}">-->
                <input type="hidden" name="comment_id" th:value="${comment.getId()}">
                <div class="layui-form-item layui-form-text">
                    <textarea  class="layui-textarea" name="content" style="resize:none" placeholder="写点什么呀"></textarea>
                </div>
                <button class="ui primary button" type="submit">评论</button>
            </form>
            <!--            写评论-->
        </div>
    </div>
</div>
<!--评论信息-->

<!--底部-->
<div class="footer">
    <p>
        <span>&copy; 2020</span>
        <span><a href="http://120.78.82.248:8080" target="_blank">计算机网络课程资源共享网</a></span>
        <span>王侃</span>
    </p>
    <p><span>长风破浪会有时，直挂云帆济沧海</span></p>
</div>
<!--底部-->

<script th:src="@{/layui/layui.js}"></script>
<script th:src="@{/layui/blog.js}">
</script>
<script>
    //    实现点赞功能
    //    实现点赞功能
</script>
</body>
</html>